#include "fxcc/imgui/Editor.h"
#include "fxcc/core/graph/common/MeshData.h"

using namespace fxcc::graph::common;
using namespace fxcc::imgui;

template <>
bool Editor::Edit<MeshData>(const std::string& label, MeshData& inst)
{
    int index = 0;

    if (TreeNode(inst.m_Name.c_str(), inst.m_ImguiFlag, index++))
    {


        if (TreeNode("info", inst.m_ImguiFlag, index++))
        {
            EditInst<std::string>("name", inst.m_Name);
            EditInst<int>("material ", inst.m_MaterialIndex);

            TreePop();
        }
        if (TreeNode("bones", inst.m_ImguiFlag, index++))
        {
            if (inst.HasBones())
            {
                for (auto it : inst.m_Bones->m_Bones)
                {
                    EditInst<Bone>("bone", it.second);
                }
            }
            TreePop();
        }
        TreePop();
    }
    return false;
}
